package com.example.blogsystem.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Created with IntelliJ IDEA.
 * Description: 统一的异常处理
 * User: DELL
 * Date: 2023-09-04
 * Time: 11:52
 */

@RestControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public ResultAjax doHandler(Exception e) {
        return ResultAjax.fail(-1, e.getMessage());
    }

}
